/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author reinaldo
 */
@Entity
@Table(name = "cardiovascular")
@NamedQueries({@NamedQuery(name = "Cardiovascular.findAll", query = "SELECT c FROM Cardiovascular c"), @NamedQuery(name = "Cardiovascular.findByIdCardio", query = "SELECT c FROM Cardiovascular c WHERE c.idCardio = :idCardio"), @NamedQuery(name = "Cardiovascular.findByMaquina", query = "SELECT c FROM Cardiovascular c WHERE c.maquina = :maquina"), @NamedQuery(name = "Cardiovascular.findByDia", query = "SELECT c FROM Cardiovascular c WHERE c.dia = :dia"), @NamedQuery(name = "Cardiovascular.findByT", query = "SELECT c FROM Cardiovascular c WHERE c.t = :t"), @NamedQuery(name = "Cardiovascular.findByFr", query = "SELECT c FROM Cardiovascular c WHERE c.fr = :fr")})
public class Cardiovascular implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /*llave primaria*/
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_cardio",nullable = false)
    private Integer idCardio;

    /*relacion muchos a muchos*/
    @ManyToMany(mappedBy="cardiovasculares")
    private List<Rutina> rutinas;


    /*atributos primitivos*/
    @Column(name = "maquina",nullable = false)
    private String maquina;
   
    @Column(name = "dia",nullable = false)
    private int dia;
    
    @Column(name = "t",nullable = false)
    private int t;
    
    @Column(name = "fr",nullable = false)
    private String fr;

    public int getDia() {
        return dia;
    }

    public void setDia(int dia) {
        this.dia = dia;
    }

    public String getFr() {
        return fr;
    }

    public void setFr(String fr) {
        this.fr = fr;
    }

    public Integer getIdCardio() {
        return idCardio;
    }

    public void setIdCardio(Integer idCardio) {
        this.idCardio = idCardio;
    }

    public String getMaquina() {
        return maquina;
    }

    public void setMaquina(String maquina) {
        this.maquina = maquina;
    }

    public List<Rutina> getRutinas() {
        return rutinas;
    }

    public void setRutinas(List<Rutina> rutinas) {
        this.rutinas = rutinas;
    }

    public int getT() {
        return t;
    }

    public void setT(int t) {
        this.t = t;
    }

    

    public Cardiovascular() {
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCardio != null ? idCardio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cardiovascular)) {
            return false;
        }
        Cardiovascular other = (Cardiovascular) object;
        if ((this.idCardio == null && other.idCardio != null) || (this.idCardio != null && !this.idCardio.equals(other.idCardio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidad.Cardiovascular[idCardio=" + idCardio + "]";
    }

}
